How to use setState to update the property of an object inside an array the right way in class compo